<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCmQuestionTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cm_question', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('subject_id')->default('0')->comment('科目ID');
            $table->string('question_text')->default('')->comment('问题文本');
            $table->longText('answer')->comment('答案解析');
            $table->tinyInteger('difficulty')->default('1')->comment('难度等级，1-5');
            $table->integer('status')->default('1')->comment('状态 1启用 2禁用');
            $table->string('problem_logo')->default('')->comment('问题logo');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cm_question');
    }
}
